package com.example.business_oa.service;

import com.example.comment_oa.dubbo.SysDeptServiceDubbo;
import com.example.comment_oa.dubbo.SysEmployeeServiceDubbo;
import com.example.comment_oa.dubbo.SysPostServiceDubbo;
import com.example.comment_oa.pojos.SysDept;
import com.example.comment_oa.pojos.SysEmployee;
import com.example.comment_oa.pojos.SysPost;
import com.example.comment_oa.pojos_vo.HySysEmpVo;
import io.seata.spring.annotation.GlobalTransactional;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description:
 * @Author:李博文
 * @Date:2022/10/27 9:32
 */
@Service
public class FuLiShenQingService {
    @DubboReference(version = "1.0.0")
    SysDeptServiceDubbo sysDeptServiceDubbo;

    @DubboReference(version = "1.0.0")
    SysPostServiceDubbo sysPostServiceDubbo;

    @DubboReference(version = "1.0.0")
    SysEmployeeServiceDubbo sysEmployeeServiceDubbo;

    @GlobalTransactional(timeoutMills = 300000)
    public List<SysDept>  selectBuMenXiaLa(){
        List<SysDept> sysDepts = sysDeptServiceDubbo.selectDepts();
        return  sysDepts;
    }

    @GlobalTransactional(timeoutMills = 300000)
    public List<SysPost>  selectZhiWeiXiaLa(){
        List<SysPost> sysPosts = sysPostServiceDubbo.selectPost();
        return  sysPosts;
    }

    @GlobalTransactional(timeoutMills = 300000)
    public List<SysEmployee>  selectAll(HySysEmpVo hySysEmpVo){
        List<SysEmployee> sysEmployees = sysEmployeeServiceDubbo.selectEmpPostDept(hySysEmpVo);
        return  sysEmployees;
    }

}
